import type { App } from 'vue'

export function autoRegisterComponent(app: App) {
  const components = import.meta.glob('@/components/*/*.vue')

  Object.keys(components).map((key) => {
    const name = key.split('/').pop()?.split('.').shift() as string
    app.component(name, components[key])
  })
}
